<template>
  <div class="remarks-style">
    <div
      class="close-box"
      :style="{ width: isMobile ? '24px' : '', height: isMobile ? '24px' : '' }"
      :class="{ 'close-2': isMobile }"
      @click="store.setChildRemarksShow(false)"
    >
      <!-- <i class="doorIcon">&#xe63d;</i> closeIconBox-->
      <img
        :style="{ width: isMobile ? '24px' : '', height: isMobile ? '24px' : '' }"
        :src="publicUrls + 'free/style5/closeIconBox.png'"
        alt=""
      />
    </div>

    <div
      class="remarks-style-conetnt"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style5/scrollBcakground1Marsk.webp'})`,
      }"
    >
      <div class="remarks-style-left">
        <p
          class="title titleStyle5"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style5/scrollBcakgroundTitleBg.webp'})`,
          }"
        >
          <span>{{ store.childTitle }}</span>
        </p>
        <!-- <p class="subtitle">{{ store.childSubTitle ? '——' : '' }}{{ store.childSubTitle }}</p> -->
        <scrollBox
          color="rgba(50, 43, 37, 1)"
          :scrollSrc="publicUrls + 'free/style5/pen.png'"
          v-if="Scrollheights"
          :remarks="store.childRemarks"
          :byid="100"
          :height="getScrollWComputed"
        >
          <template #solidBorder>
            <div class="solidBorder-child"></div>
          </template>
        </scrollBox>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'styleOne',
});
</script>

<script setup lang="ts">
import { getMobileType } from '@/utils/getMoble';
import { publicUrls } from '@/utils/minxin';
import scrollBox from '../scrollBox.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';

const isMobile = ref(false);
isMobile.value = getMobileType();
const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 495;
const getScrollWComputed = computed(() => {
  if (store.isMobileType) {
    let rootNode = document.documentElement;

    let computedStyle = window.getComputedStyle(rootNode);

    let fontSize = computedStyle.fontSize;

    let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
    // let heights = (fontSizeNumber / 144)
    let heights = (fontSizeNumber / 144) * 456;
    return heights;
  } else {
    return Scrollheights.value;
  }
});
</script>   

<style scoped lang="less">
.remarks-style {   
  display: flex;  
  flex-direction: column; 
  position: relative;
  //   width: 100%;
  //   max-width: 1200px;
  width: 1200px;
  height: 760px;
  background: transparent;

  transform: translateZ(0px);
}
.remarks-style-conetnt {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  //   background: #fff;
  background-repeat: no-repeat;
  background-size: 100% 100%;

  padding-top: 47px;
  border: 1px solid rgba(0, 0, 0, 0.1)
  //   object-fit: contain;
}
.title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 471px;
  height: 80px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin-bottom: 40px;
  margin-left: -19.5px;
  span {
    font-family: SourceBold;
    font-size: 18px;
    line-height: 24px;
    color: rgba(231, 229, 228, 1);
  }
}
.subtitle {
  width: 100%;
  margin-top: 56px;
  height: 24px;
  margin-bottom: 16px;
  text-align: center;
  font-family: SourceMedium;
  font-size: 18px;
  color: #2f1b16;
  line-height: 24px;
  opacity: 0.8; 
}
.remarks-style-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  // flex: 1;
  width: 100%;
  padding-right: 28px;
  padding-left: 117px;
  height: 100%;
}
.solidBorder-child {
  width: 4px;
  height: 100%;
  background: rgba(190, 212, 206, 1);
  border-radius: 1px;
  opacity: 0.5;
  //   border-left: 2px solid rgba(81, 81, 81, 1);
  //   border-right: 2px solid rgba(81, 81, 81, 1);
}

.close-box {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 48px;
  right: 20px;
  width: 40px;
  height: 40px; 
  z-index: 30;  
  img {     
    width: 100%;     
    height: 100%;   
    object-fit: contain;
  } 
}    
.close-2 {  
  cursor: pointer;
  display: flex;  
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 48px;
  right: 20px;
  width: 32px;
  height: 32px;

  z-index: 30;
  img {
    width: 100%;
    height:  100%;
  }
}
::v-deep .templatestyle1-scroll-box-tumb {
  align-items: center;
  justify-content: center;
  img {
    width: 24px;
    height: 24px; 
  }
}
::v-deep {
  .solid-box-parent {
    width: 32px;
  }
  .unit-exbi-remarks-info-remarks {
    width: calc(100% - 39px);
  }
}
:deep(.unit-exbi-remarks-info-remarks p) {
  font-family: PingFang SC;
  font-weight: 400;
  font-size: 16px !important;
  color: rgba(231, 229, 228, 1) !important;
  line-height: 32px !important;
}
</style>
